package com.xxx;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.57.1)",
    comments = "Source: FutureStubTest.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class FutureStubTestServiceGrpc {

  private FutureStubTestServiceGrpc() {}

  public static final java.lang.String SERVICE_NAME = "FutureStubTestService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.xxx.FutureStubTestProto.FutureStubTestRequest,
      com.xxx.FutureStubTestProto.FutureStubTestResponse> getTestxxxMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "testxxx",
      requestType = com.xxx.FutureStubTestProto.FutureStubTestRequest.class,
      responseType = com.xxx.FutureStubTestProto.FutureStubTestResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.xxx.FutureStubTestProto.FutureStubTestRequest,
      com.xxx.FutureStubTestProto.FutureStubTestResponse> getTestxxxMethod() {
    io.grpc.MethodDescriptor<com.xxx.FutureStubTestProto.FutureStubTestRequest, com.xxx.FutureStubTestProto.FutureStubTestResponse> getTestxxxMethod;
    if ((getTestxxxMethod = FutureStubTestServiceGrpc.getTestxxxMethod) == null) {
      synchronized (FutureStubTestServiceGrpc.class) {
        if ((getTestxxxMethod = FutureStubTestServiceGrpc.getTestxxxMethod) == null) {
          FutureStubTestServiceGrpc.getTestxxxMethod = getTestxxxMethod =
              io.grpc.MethodDescriptor.<com.xxx.FutureStubTestProto.FutureStubTestRequest, com.xxx.FutureStubTestProto.FutureStubTestResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "testxxx"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xxx.FutureStubTestProto.FutureStubTestRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xxx.FutureStubTestProto.FutureStubTestResponse.getDefaultInstance()))
              .setSchemaDescriptor(new FutureStubTestServiceMethodDescriptorSupplier("testxxx"))
              .build();
        }
      }
    }
    return getTestxxxMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static FutureStubTestServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<FutureStubTestServiceStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<FutureStubTestServiceStub>() {
        @java.lang.Override
        public FutureStubTestServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new FutureStubTestServiceStub(channel, callOptions);
        }
      };
    return FutureStubTestServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static FutureStubTestServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<FutureStubTestServiceBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<FutureStubTestServiceBlockingStub>() {
        @java.lang.Override
        public FutureStubTestServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new FutureStubTestServiceBlockingStub(channel, callOptions);
        }
      };
    return FutureStubTestServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static FutureStubTestServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<FutureStubTestServiceFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<FutureStubTestServiceFutureStub>() {
        @java.lang.Override
        public FutureStubTestServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new FutureStubTestServiceFutureStub(channel, callOptions);
        }
      };
    return FutureStubTestServiceFutureStub.newStub(factory, channel);
  }

  /**
   */
  public interface AsyncService {

    /**
     */
    default void testxxx(com.xxx.FutureStubTestProto.FutureStubTestRequest request,
        io.grpc.stub.StreamObserver<com.xxx.FutureStubTestProto.FutureStubTestResponse> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getTestxxxMethod(), responseObserver);
    }
  }

  /**
   * Base class for the server implementation of the service FutureStubTestService.
   */
  public static abstract class FutureStubTestServiceImplBase
      implements io.grpc.BindableService, AsyncService {

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return FutureStubTestServiceGrpc.bindService(this);
    }
  }

  /**
   * A stub to allow clients to do asynchronous rpc calls to service FutureStubTestService.
   */
  public static final class FutureStubTestServiceStub
      extends io.grpc.stub.AbstractAsyncStub<FutureStubTestServiceStub> {
    private FutureStubTestServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected FutureStubTestServiceStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new FutureStubTestServiceStub(channel, callOptions);
    }

    /**
     */
    public void testxxx(com.xxx.FutureStubTestProto.FutureStubTestRequest request,
        io.grpc.stub.StreamObserver<com.xxx.FutureStubTestProto.FutureStubTestResponse> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getTestxxxMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   * A stub to allow clients to do synchronous rpc calls to service FutureStubTestService.
   */
  public static final class FutureStubTestServiceBlockingStub
      extends io.grpc.stub.AbstractBlockingStub<FutureStubTestServiceBlockingStub> {
    private FutureStubTestServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected FutureStubTestServiceBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new FutureStubTestServiceBlockingStub(channel, callOptions);
    }

    /**
     */
    public com.xxx.FutureStubTestProto.FutureStubTestResponse testxxx(com.xxx.FutureStubTestProto.FutureStubTestRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getTestxxxMethod(), getCallOptions(), request);
    }
  }

  /**
   * A stub to allow clients to do ListenableFuture-style rpc calls to service FutureStubTestService.
   */
  public static final class FutureStubTestServiceFutureStub
      extends io.grpc.stub.AbstractFutureStub<FutureStubTestServiceFutureStub> {
    private FutureStubTestServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected FutureStubTestServiceFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new FutureStubTestServiceFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.xxx.FutureStubTestProto.FutureStubTestResponse> testxxx(
        com.xxx.FutureStubTestProto.FutureStubTestRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getTestxxxMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_TESTXXX = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final AsyncService serviceImpl;
    private final int methodId;

    MethodHandlers(AsyncService serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_TESTXXX:
          serviceImpl.testxxx((com.xxx.FutureStubTestProto.FutureStubTestRequest) request,
              (io.grpc.stub.StreamObserver<com.xxx.FutureStubTestProto.FutureStubTestResponse>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        .addMethod(
          getTestxxxMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              com.xxx.FutureStubTestProto.FutureStubTestRequest,
              com.xxx.FutureStubTestProto.FutureStubTestResponse>(
                service, METHODID_TESTXXX)))
        .build();
  }

  private static abstract class FutureStubTestServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    FutureStubTestServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.xxx.FutureStubTestProto.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("FutureStubTestService");
    }
  }

  private static final class FutureStubTestServiceFileDescriptorSupplier
      extends FutureStubTestServiceBaseDescriptorSupplier {
    FutureStubTestServiceFileDescriptorSupplier() {}
  }

  private static final class FutureStubTestServiceMethodDescriptorSupplier
      extends FutureStubTestServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final java.lang.String methodName;

    FutureStubTestServiceMethodDescriptorSupplier(java.lang.String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (FutureStubTestServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new FutureStubTestServiceFileDescriptorSupplier())
              .addMethod(getTestxxxMethod())
              .build();
        }
      }
    }
    return result;
  }
}
